

package com.hazelcast.jet.impl.deployment;

import childfirstclassloader.TestProcessor;
import com.hazelcast.jet.core.ProcessorMetaSupplier;
import com.hazelcast.jet.pipeline.BatchSource;
import com.hazelcast.jet.pipeline.Sources;
import com.hazelcast.jet.pipeline.StreamSource;

public class SourceWithClassLoader {

    public static BatchSource<String> batchSource(String name) {
        BatchSource<String> source = Sources.batchFromProcessor(name, ProcessorMetaSupplier.of(() -> new TestProcessor(TestProcessor.ResourceReader::new)));
        return source;
    }

    public static StreamSource<String> streamSource(String name) {
        StreamSource<String> source = Sources.streamFromProcessor(name, ProcessorMetaSupplier.of(() -> new TestProcessor(TestProcessor.ResourceReader::new)));
        return source;
    }

}
